import axios from 'axios';


export const gaoshiApi = {
	gachaHigh: () => {
		return axios.get('https://api.redbean.tech/gacha/high');
	},

	gachaCustom: () => {
		return axios.get('https://api.redbean.tech/gacha/custom');
	},

	gachaSpecial: () => {
		return axios.get('https://api.redbean.tech/gacha/special');
	},

	getAllEquipment: () => {
		return axios.get('https://api.redbean.tech/illustrate/all?server=merged');
	},

	getEquipmentById: (id) => {
		return axios.get('https://api.redbean.tech/illustrate/id/' + id);
	},

	getEquipmentByTitle: (title) => {
		return axios.get('https://api.redbean.tech/illustrate/title/' + title);
	},

	getYiyan: () => {
		return axios.get('https://v1.hitokoto.cn/');
	},

	getImgSrc: (img) => {
		img = img.toString();
		const prefix = 'https://static.image.mihoyo.com/hsod2_webview/images/broadcast_top/equip_icon/png/';
		if (img.length < 3) img = ('000' + img).slice(-3);
		return prefix + img + '.png';
	},

	// 觉醒图，访问不了
	getSpecImg: (img) => {
		return 'https://api-1256168079.cos.ap-chengdu.myqcloud.com/${img}';
	},

	// 怪物头像
	getBubbleSrc: (img) => {
		return "https://static.image.mihoyo.com/hsod2_webview/images/broadcast_top/equip_website/bubble/" +
			img + '.png';
	},

	// type: equipment装备，elite_skill精英技能，zombie僵尸娘
	getBBInfo: (type, pagenum, pagesize) => {
		data = {
			"type": type,
			"page_num": pagenum,
			"page_size": pagesize
		};
		return axios.post("https://www.benghuai.com/data/getData", data);
	},
}
